forked from minibloxio/blockcraft-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (32 loc) · 934 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# webpacker container
FROM node:16-alpine AS webpack-builder
WORKDIR /webpack
COPY ./client/tsconfig.json ./
COPY ./client/webpack.config.js ./
COPY ./client/package.json ./
COPY ./client/package-lock.json ./
RUN npm install
COPY ./client/public ./public
COPY ./client/assets ./assets
COPY ./client/src ./src
RUN npm run build
# production container
FROM node:16-alpine AS node
# Install app dependencies
COPY ./server/package.json ./
COPY ./server/package-lock.json ./
RUN npm ci --only=production
WORKDIR /usr/src/app
ENV TEXTURES_PATH="/textures"
COPY ./client/assets/textures/blocks /textures/blocks
COPY ./client/assets/textures/entity /textures/entity
COPY ./client/assets/textures/items /textures/items
COPY --from=webpack-builder /webpack/dist ./dist
COPY ./server/worker.js .
COPY ./server/app.js .
COPY ./server/modules ./modules
# set port for server
ENV PORT=3000
# expose port
EXPOSE 3000
CMD [ "node", "app.js" ]