Build docker image

This commit is contained in:
HitomaruKonpaku 2023-08-29 12:47:41 +07:00
parent f6eeef28c5
commit f0a302d18e
5 changed files with 49 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
node_modules/
dist/
tests/
.vscode/

3
build.sh Normal file
View File

@ -0,0 +1,3 @@
docker build \
-f docker/Dockerfile \
-t antiboredom/ffmpeg-explorer .

15
docker/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM node:18-alpine AS build
WORKDIR /app
COPY package.json .
COPY package-lock.json .
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:stable-alpine-slim
COPY ./docker/etc/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80

View File

@ -0,0 +1,8 @@
---
services:
ffmpeg-explorer:
image: antiboredom/ffmpeg-explorer
container_name: ffmpeg-explorer
restart: unless-stopped
ports:
- 3000:80

19
docker/etc/nginx.conf Normal file
View File

@ -0,0 +1,19 @@
events {
multi_accept on;
}
http {
include /etc/nginx/mime.types;
server_tokens off;
server {
listen 80;
charset utf-8;
sendfile on;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html = 404;
}
}
}