mirror of
https://github.com/xzeldon/zeldon-site.git
synced 2024-12-25 05:45:47 +00:00
add docker
This commit is contained in:
parent
5e6bdacdbb
commit
618fc16ed8
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
dist
|
17
Dockerfile
Normal file
17
Dockerfile
Normal 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
12
docker-compose.yml
Normal 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
10
nginx/nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user