Skip to content

Commit 3cc10bd

Browse files
committed
[docker] create docker image with just nginx and the build folder
1 parent 27953f5 commit 3cc10bd

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.github/workflows/deploy-docker.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ jobs:
2222
- name: Check out the repo
2323
uses: actions/checkout@v4
2424

25+
- name: Install
26+
run: npm install
27+
28+
- name: Build
29+
run: npm run build
30+
env:
31+
BASE_URL: "./"
32+
2533
- name: Log in to Docker Hub
2634
uses: docker/login-action@v3
2735
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ yarn-error.log*
2828
/test-results/
2929
/playwright-report/
3030
/playwright/.cache/
31+
tsconfig.tsbuildinfo

Dockerfile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
FROM node:20
2-
ARG BASE_URL="/"
1+
FROM nginx:latest
32

4-
RUN apt-get -qq update && apt-get -qqy install nginx && apt-get clean
5-
6-
COPY . /opt/code
7-
WORKDIR /opt/code
8-
RUN npm install && npm cache clean --force
9-
RUN npm run build
10-
RUN rm /var/www/html/*
11-
RUN cp -f nginx.conf /etc/nginx/sites-available/default
12-
RUN cp -R build/* /var/www/html/
3+
COPY ./build/ /var/www/html/
4+
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
135

146
EXPOSE 80
157

0 commit comments

Comments
 (0)