Added docker config

main
Eloi Zalczer 2024-06-17 13:58:06 +02:00
parent ad56794b95
commit 1540527b9c
5 changed files with 57 additions and 0 deletions

10
.dockerignore 100644
View File

@ -0,0 +1,10 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode

15
Dockerfile 100644
View File

@ -0,0 +1,15 @@
# build environment
FROM node:16-alpine as build
WORKDIR /app
COPY package.json ./
RUN ["npm", "install"]
COPY . .
RUN ["npm", "run", "build"]
# production environment
FROM nginx:stable-alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

15
docker-compose.yml 100644
View File

@ -0,0 +1,15 @@
version: "3.8"
services:
web:
image: "doxfood"
build:
context: .
dockerfile: Dockerfile
ports:
- "${DOXFOOD_SERVER_PORT:-9000}:80"
environment:
TZ: "Europe/Paris"
restart: unless-stopped

17
nginx/default.conf 100644
View File

@ -0,0 +1,17 @@
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}