forked from w3champions/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (31 loc) · 854 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
# build stage
FROM node:20-bullseye as build-stage
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn run build:prod
# production stage
FROM nginx:stable-alpine as production-stage
# Nginx config
RUN rm -rf /etc/nginx/conf.d
COPY gzip.conf /etc/nginx/conf.d/
COPY default.conf /etc/nginx/conf.d/
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Put env variables into container
WORKDIR /usr/share/nginx/html
COPY env.sh .
RUN apk add --no-cache bash
RUN chmod +x env.sh
RUN apk add --no-cache \
python3 py3-pip \
curl \
which \
bash
RUN pip install python-dateutil python-magic s3cmd --break-system-packages
COPY s3config /etc/s3config
RUN chmod +x /etc/s3config/sync_assets.sh
ADD start.sh /
RUN chmod +x /start.sh
EXPOSE 80
CMD ["/bin/bash", "-c", "/start.sh && nginx -g \"daemon off;\""]