forked from pranjalanimesh/phaser-tw-game-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (27 loc) · 982 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
40
# syntax=docker/dockerfile:1
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Dockerfile reference guide at
# https://docs.docker.com/go/dockerfile-reference/
ARG NODE_VERSION=18.18.0
FROM node:${NODE_VERSION}-alpine
# Create a group and user
RUN addgroup -S app && adduser -S app -G app
# Use production node environment by default.
ENV NODE_ENV development
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json for dependency installation
COPY package.json package-lock.json ./
# Install dependencies
RUN npm ci --omit=dev
# Change ownership of the working directory
# This is done here to ensure that all copied files/directories
# have the correct permissions.
RUN chown -R app:app /app
COPY --chown=app:app . .
# Use the non-root user to run the application
USER app
# Expose the port that the application listens on.
EXPOSE 3000 6789
# Run the application.
CMD ["npm", "start"]