mirror of
https://github.com/dmuth/diceware.git
synced 2024-11-23 09:16:29 -05:00
Adds Dockerfile to build a container image which hosts diceware
The container is built in two steps (docker builder pattern): 1. Node/npm build stage 2. Final image with Nginx and static files to serve Build the mage with this command: docker image build -t dceware . Run a container with this command: docker run --rm -p 8080:80 dceware Then you can visit your local diceware at: http://localhost:8080/ Signed-off-by: Sven Strittmatter <ich@weltraumschaf.de>
This commit is contained in:
parent
ab554dde7b
commit
965e503aec
1 changed files with 18 additions and 0 deletions
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
FROM node:20-bullseye-slim as builder
|
||||||
|
|
||||||
|
RUN mkdir /tmp/diceware
|
||||||
|
COPY . /tmp/diceware/
|
||||||
|
WORKDIR /tmp/diceware
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM nginx:1.25-bullseye
|
||||||
|
|
||||||
|
COPY --from=builder /tmp/diceware/assets /usr/share/nginx/html/assets/
|
||||||
|
COPY --from=builder /tmp/diceware/dist /usr/share/nginx/html/dist/
|
||||||
|
COPY --from=builder /tmp/diceware/fonts /usr/share/nginx/html/fonts
|
||||||
|
COPY --from=builder /tmp/diceware/favicon.ico /usr/share/nginx/html/favicon.ico
|
||||||
|
COPY --from=builder /tmp/diceware/index.html /usr/share/nginx/html/index.html
|
||||||
|
COPY --from=builder /tmp/diceware/robots.txt /usr/share/nginx/html/robots.txt
|
||||||
|
|
||||||
|
RUN chmod -R a+rX /usr/share/nginx/html
|
Loading…
Reference in a new issue