generated from Unreal-Kingdoms/UK-Svelte-Docker-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (22 loc) · 894 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
#Dockerfile
# Use this image as the platform to build the app
FROM node:18-alpine AS external-website
# A small line inside the image to show who made it
LABEL Developers="Unreal Kingdoms Devs"
# The WORKDIR instruction sets the working directory for everything that will happen next
WORKDIR /app
# Copy all local files into the image
COPY . .
# Avoid Vite permission error
RUN mkdir /app/node_modules/ || true
RUN mkdir /app/node_modules/.vite || true
RUN chown -R node:node /app/node_modules/.vite || true
# Clean install all node modules
RUN npm i
#Fix permission errors for node
RUN chown -R node:node /app/
RUN chmod -R 777 /app/
# The USER instruction sets the user name to use as the default user for the remainder of the current stage
USER node:node
# This is the command that will be run inside the image when you tell Docker to start the container
CMD ["npm","run","start"]