wireadmin/Dockerfile-Dev

52 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-11-02 11:04:25 +00:00
FROM oven/bun:alpine as base
LABEL Maintainer="Shahrad Elahi <https://github.com/shahradelahi>"
WORKDIR /usr/src/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
RUN apk add -U --no-cache \
iproute2 iptables net-tools \
screen vim curl bash \
wireguard-tools \
openssl \
dumb-init \
2023-09-18 17:31:07 +00:00
tor \
redis
2023-09-24 19:18:39 +00:00
2023-11-02 11:04:25 +00:00
FROM base AS deps
2023-09-24 19:18:39 +00:00
2023-11-02 11:04:25 +00:00
RUN mkdir -p /temp/dev
COPY web/package.json web/bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
2023-09-24 19:18:39 +00:00
2023-11-02 11:04:25 +00:00
RUN mkdir -p /temp/prod
COPY web/package.json web/bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM install AS build
COPY --from=deps /temp/dev/node_modules node_modules
COPY web .
2023-11-02 11:04:25 +00:00
# build
ENV NODE_ENV=production
RUN bun run build
2023-11-02 11:04:25 +00:00
FROM base AS release
COPY --from=deps /temp/prod/node_modules node_modules
COPY --from=build /usr/src/app/build .
COPY --from=build /usr/src/app/package.json .
ENV NODE_ENV=production
# run the app
USER bun
EXPOSE 3000/tcp
CMD [ "bun", "start" ]