-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (28 loc) · 902 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
# We don't want to start from scratch.
# That is why we tell node here to use the current node image as base.
FROM node:alpine3.11
# Create an application directory
RUN mkdir -p /app
# The /app directory should act as the main application directory
WORKDIR /app
# Copy the app package and package-lock.json file
COPY frontend/package*.json ./
# Install node packages
RUN npm install
# Copy or project directory (locally) in the current directory of our docker image (/app)
COPY frontend/ .
# Build the app
RUN npm run build
# Expose $PORT on container.
# We use a varibale here as the port is something that can differ on the environment.
EXPOSE $PORT
# Set host to localhost / the docker image
ENV NUXT_HOST=0.0.0.0
# Set app port
ENV NUXT_PORT=$PORT
# Set the base url
ENV PROXY_API=$PROXY_API
# Set the browser base url
ENV PROXY_LOGIN=$PROXY_LOGIN
# Start the app
CMD [ "npm", "start" ]