add docker

This commit is contained in:
Timofey Gelazoniya 2023-06-13 21:26:11 +03:00
parent 5e6bdacdbb
commit 618fc16ed8
Signed by: zeldon
GPG Key ID: 047886915281DD2A
4 changed files with 41 additions and 0 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
dist

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM node:20-slim as build
WORKDIR /opt
COPY ./package.json /opt/package.json
COPY ./package-lock.json /opt/package-lock.json
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:1.24-alpine-slim
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /opt/dist /usr/share/nginx/html

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: "3"
services:
zeldon-site:
image: zeldon-site:latest
container_name: zeldon-site
build:
context: .
dockerfile: Dockerfile
ports:
- 3123:80
restart: unless-stopped

10
nginx/nginx.conf Normal file
View File

@ -0,0 +1,10 @@
server {
listen 80;
# path to files for serve
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}