-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (31 loc) · 1.11 KB
/
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
41
42
43
# syntax=docker/dockerfile:1
FROM node:current-alpine
# Setting environment variables coming from the GitHub actions secrets
ARG NEXT_PUBLIC_BACKEND_URL
ENV NEXT_PUBLIC_BACKEND_URL=${NEXT_PUBLIC_BACKEND_URL}
ARG NEXT_PUBLIC_PLACEHOLDER_IMAGE
ENV NEXT_PUBLIC_PLACEHOLDER_IMAGE=${NEXT_PUBLIC_PLACEHOLDER_IMAGE}
ARG NEXT_PUBLIC_UPLOAD_IMAGE
ENV NEXT_PUBLIC_UPLOAD_IMAGE=${NEXT_PUBLIC_UPLOAD_IMAGE}
ARG NEXT_PUBLIC_CLOUDINARY_UPLOAD_URL
ENV NEXT_PUBLIC_CLOUDINARY_UPLOAD_URL=${NEXT_PUBLIC_CLOUDINARY_UPLOAD_URL}
# updating alpine package manager
RUN apk add --update tini
# creating the directory that will hold our code
RUN mkdir -p /usr/jardinbinario/app
# moving to that directory inside of the container
WORKDIR /usr/jardinbinario/app
# copying package.json and package-lock.json to the container
COPY package.json package.json
COPY package-lock.json package-lock.json
# installing via the recommended way for Docker (not npm install)
RUN npm ci
# copying our source code
COPY . .
#exposing port 3000
EXPOSE 3000
# building the 'production' version
# RUN npm run build
# running our code
RUN npm run build
CMD ["npm", "start"]