Skip to content

Commit

Permalink
fixed Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Oct 20, 2023
1 parent 4b30d17 commit 7c050b8
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# build env
FROM node:18-slim AS build-env
# build-server env
FROM node:18-slim AS build-server-env
WORKDIR /build
COPY package*.json ./
RUN npm install
COPY . .
COPY ./libs libs
COPY ./tsconfig.json .
COPY ./webpack.config.js .
COPY ./src src
RUN npm run bundle

# build-client env
FROM node:18-slim AS build-client-env
WORKDIR /build
COPY faucet-client/package*.json ./faucet-client/
COPY ./libs libs
COPY ./static static
RUN cd faucet-client && npm install
COPY ./faucet-client faucet-client
RUN cd faucet-client && node ./build-client.js

# final stage
FROM node:18-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN update-ca-certificates
COPY --from=build-env /build/dist ./dist
COPY --from=build-env /build/static ./static
COPY --from=build-env /build/faucet-config.example.yaml .
COPY --from=build-server-env /build/dist ./dist
COPY --from=build-client-env /build/static ./static
COPY ./faucet-config.example.yaml .
RUN cp ./static/index.html ./static/index.seo.html && chmod 777 ./static/index.seo.html

EXPOSE 8080
Expand Down

0 comments on commit 7c050b8

Please sign in to comment.