From f0a302d18ee350010a17c340f2b6933a4234c144 Mon Sep 17 00:00:00 2001 From: HitomaruKonpaku Date: Tue, 29 Aug 2023 12:47:41 +0700 Subject: [PATCH] Build docker image --- .dockerignore | 4 ++++ build.sh | 3 +++ docker/Dockerfile | 15 +++++++++++++++ docker/docker-compose.yaml | 8 ++++++++ docker/etc/nginx.conf | 19 +++++++++++++++++++ 5 files changed, 49 insertions(+) create mode 100644 .dockerignore create mode 100644 build.sh create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yaml create mode 100644 docker/etc/nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c11ed9f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +tests/ +.vscode/ diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..31e1a4e --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +docker build \ + -f docker/Dockerfile \ + -t antiboredom/ffmpeg-explorer . diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..fb2c316 --- /dev/null +++ b/docker/Dockerfile @@ -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 diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml new file mode 100644 index 0000000..8508ad5 --- /dev/null +++ b/docker/docker-compose.yaml @@ -0,0 +1,8 @@ +--- +services: + ffmpeg-explorer: + image: antiboredom/ffmpeg-explorer + container_name: ffmpeg-explorer + restart: unless-stopped + ports: + - 3000:80 diff --git a/docker/etc/nginx.conf b/docker/etc/nginx.conf new file mode 100644 index 0000000..bdd9e36 --- /dev/null +++ b/docker/etc/nginx.conf @@ -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; + } + } +}