-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 835 Bytes
/
Dockerfile
File metadata and controls
38 lines (28 loc) · 835 Bytes
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
# This is a dockerfile for NodeJS server deployments
# Project: https://gitlab.com/richardnagy/container-environments/server-deployments
FROM node:18
# Expose api port
EXPOSE 8080
# Move source
WORKDIR /app
COPY . .
# Install package manager
#RUN npm install -g pnpm
# Install dependencies
RUN yarn install --frozen-lockfile -only=production
#RUN npm install --frozen-lockfile -only=production
#RUN pnpm install --frozen-lockfile -only=production
# Create user
RUN groupadd --gid 1001 server && \
useradd --uid 1001 --gid server --shell /bin/bash --create-home server
# Change project ownership to server user
RUN chown -R server:server /app
# Switch user
USER server
# Start app
ENTRYPOINT [ "yarn" ]
#ENTRYPOINT [ "npm run" ]
#ENTRYPOINT [ "pnpm run" ]
#ENTRYPOINT [ "npx pm2-runtime start" ]
# Command
CMD [ "start" ]