wireadmin/Dockerfile-Dev

61 lines
1.5 KiB
Plaintext
Raw Normal View History

FROM node:alpine as base
2023-11-02 11:04:25 +00:00
LABEL Maintainer="Shahrad Elahi <https://github.com/shahradelahi>"
WORKDIR /app
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2023-09-27 07:01:52 +00:00
COPY --from=chriswayg/tor-alpine:latest /usr/local/bin/obfs4proxy /usr/local/bin/obfs4proxy
COPY --from=chriswayg/tor-alpine:latest /usr/local/bin/meek-server /usr/local/bin/meek-server
2023-11-02 13:02:33 +00:00
# Update and upgrade packages
2024-02-12 06:55:37 +00:00
RUN apk update && apk upgrade &&\
2023-12-10 23:20:54 +00:00
# Install required packages
2024-02-12 06:55:37 +00:00
apk add -U --no-cache \
2023-12-10 23:20:54 +00:00
iproute2 iptables net-tools \
screen vim curl bash \
wireguard-tools \
tor &&\
# NPM packages
npm install -g @litehex/node-checksum &&\
2023-12-10 23:20:54 +00:00
# Clear APK cache
rm -rf /var/cache/apk/*
2024-02-12 06:55:37 +00:00
# Copy Tor Configs
2023-12-19 09:51:23 +00:00
COPY /config/torrc /etc/tor/torrc
COPY /config/obfs4-bridges.conf /etc/torrc.d/obfs4-bridges.conf
2024-02-12 06:55:37 +00:00
# Copy user scripts
2024-01-08 10:23:35 +00:00
COPY /bin /usr/local/bin
RUN chmod -R +x /usr/local/bin
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-02-12 06:55:37 +00:00
# Base env
ENV ORIGIN=http://127.0.0.1:5173,http://localhost:5173
ENV PROTOCOL_HEADER=x-forwarded-proto
ENV HOST_HEADER=x-forwarded-host
FROM base AS runner
ENV NODE_ENV=development
ENV LOG_LEVEL=debug
2024-02-12 06:55:37 +00:00
2023-12-10 23:20:54 +00:00
COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
RUN mkdir -p /data && chmod 700 /data
RUN mkdir -p /etc/torrc.d && chmod -R 400 /etc/torrc.d
2024-01-08 10:23:35 +00:00
RUN mkdir -p /var/vlogs && touch /var/vlogs/web && chmod -R 600 /var/vlogs
2023-12-19 05:00:54 +00:00
VOLUME ["/etc/torrc.d", "/data", "/var/vlogs"]
2024-01-08 10:23:35 +00:00
# run the app
2023-11-02 13:02:33 +00:00
EXPOSE 5173/tcp
CMD [ "npm", "run", "dev", "--", "--host" ]