Skip to content

Commit

Permalink
feat: init Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Jul 26, 2024
1 parent 0b80274 commit d7f9fe1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:20 as build
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build


FROM nginx
RUN rm etc/nginx/conf.d/default.conf
COPY conf/nginx.conf etc/nginx/conf.d/
COPY --from=build /app/build /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
14 changes: 14 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
server {
listen 8080 default_server;
server_name /usr/share/nginx/html;
root /usr/share/nginx/html;
index index.html;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_comp_level 9;
etag on;
location / {
try_files $uri $uri/ /index.html;
}
}

0 comments on commit d7f9fe1

Please sign in to comment.