-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (32 loc) · 846 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
41
# Front End
FROM node:18-alpine AS webbuild
ARG REACT_APP_API_ENDPOINT=http://localhost/api
WORKDIR /web
COPY frontend .
RUN npm install && npm run build
# Full App
FROM nginx:stable-alpine
WORKDIR /app
ENV NODE_ENV=production \
BACKEND_PORT=4000 \
# DO NOT MODIFY BACKEND_PORT
DB_URL="" \
R2_ACCOUNT_ID="" \
R2_ACCOUNT_KEY="" \
R2_ACCOUNT_SECRET="" \
R2_BUCKET_NAME="" \
R2_PUBLIC_URL=""
COPY /config/start.sh /start.sh
COPY /config/nginx.conf /etc/nginx/nginx.conf
COPY backend /app
RUN apk update \
&& apk upgrade \
&& apk add --update ca-certificates coreutils bash npm \
&& update-ca-certificates \
&& npm install \
&& rm -rf /var/cache/apk/* \
&& rm -rf /usr/share/nginx/html \
&& chmod +x /start.sh
COPY --from=webbuild /web/build /usr/share/nginx/html
ENTRYPOINT /start.sh
EXPOSE 80