wireadmin/Dockerfile-Dev

52 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2024-02-15 08:16:16 +00:00
ARG ALPINE_VERSION=3.19
2024-04-01 14:19:30 +00:00
ARG NODE_VERSION=20
2024-05-29 16:40:18 +00:00
FROM --platform=$BUILDPLATFORM shahradel/torproxy:latest as tor
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-alpine${ALPINE_VERSION} as node
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2024-05-29 16:40:18 +00:00
RUN apk update \
&& apk upgrade \
&& apk add -U --no-cache \
iptables net-tools \
screen logrotate bash \
wireguard-tools \
dnsmasq \
tor \
&& rm -rf /var/cache/apk/*
FROM node
WORKDIR /app
2023-12-19 09:51:23 +00:00
2024-02-12 06:55:37 +00:00
# Setup Pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
2024-05-29 16:40:18 +00:00
ENV NODE_ENV=development
ENV LOG_LEVEL=debug
2024-02-12 06:55:37 +00:00
ENV PROTOCOL_HEADER=x-forwarded-proto
ENV HOST_HEADER=x-forwarded-host
2024-05-29 16:40:18 +00:00
COPY --from=tor /usr/local/bin/lyrebird /usr/local/bin/lyrebird
COPY rootfs /
# Fix permissions
2024-05-29 16:40:18 +00:00
RUN mkdir -p /data/ && chmod 700 /data/
RUN mkdir -p /etc/tor/torrc.d/ && chmod -R 400 /etc/tor/
RUN mkdir -p /var/log/wireadmin/ && touch /var/log/wireadmin/web.log
RUN echo '* * * * * /usr/bin/env logrotate /etc/logrotate.d/rotator' > /etc/crontabs/root
2024-02-15 08:16:16 +00:00
# Setup entrypoint
COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# Volumes
2024-05-29 16:40:18 +00:00
VOLUME ["/etc/tor", "/var/lib/tor", "/data"]
# Run the app
2023-11-02 13:02:33 +00:00
EXPOSE 5173/tcp
2024-04-01 14:19:30 +00:00
CMD [ "npm", "run", "dev", "--", "--host" ]