Skip to content

Commit

Permalink
[docker] create docker image with just nginx and the build folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sim51 committed Dec 4, 2024
1 parent 27953f5 commit 3cc10bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Install
run: npm install

- name: Build
run: npm run build
env:
BASE_URL: "./"

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ yarn-error.log*
/test-results/
/playwright-report/
/playwright/.cache/
tsconfig.tsbuildinfo
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
FROM node:20
ARG BASE_URL="/"
FROM nginx:latest

RUN apt-get -qq update && apt-get -qqy install nginx && apt-get clean

COPY . /opt/code
WORKDIR /opt/code
RUN npm install && npm cache clean --force
RUN npm run build
RUN rm /var/www/html/*
RUN cp -f nginx.conf /etc/nginx/sites-available/default
RUN cp -R build/* /var/www/html/
COPY ./build/ /var/www/html/
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

Expand Down

0 comments on commit 3cc10bd

Please sign in to comment.