-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 698 Bytes
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 698 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
# Setup Base Image
FROM nginx:alpine AS webserver
FROM node:lts-alpine AS base
# Install Dependency On Backend
FROM base AS backend
WORKDIR /app
COPY ./backend/ ./
RUN npm install
# Install Dependency On Frontend & Build Frontend
FROM base AS frontend
WORKDIR /app
COPY ./frontend/ ./
RUN npm install
RUN npm run build
# Server
FROM webserver AS prod
WORKDIR /app
COPY --from=frontend /app/dist/ /usr/share/nginx/html
COPY --from=backend /app/ /app/
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN rm /etc/nginx/conf.d/default.conf
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
RUN apk add nodejs
RUN rm -rf /var/cache/apk/*
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]