mirror of
https://github.com/MarcZierle/photo-log-frontend.git
synced 2025-04-12 07:04:36 +00:00
create docker files
This commit is contained in:
parent
7224faf5db
commit
b4ac02c0bf
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
**/node_modules
|
||||||
|
dist/
|
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
FROM node:19.0.0-alpine3.16 AS builder
|
||||||
|
|
||||||
|
# create user, group and home directory
|
||||||
|
RUN mkdir -p /home/app
|
||||||
|
RUN addgroup -S app && adduser -S app -G app
|
||||||
|
WORKDIR /home/app
|
||||||
|
|
||||||
|
# install GCC
|
||||||
|
RUN apk add build-base
|
||||||
|
|
||||||
|
# install Python
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
|
||||||
|
RUN python3 -m ensurepip
|
||||||
|
RUN pip3 install --no-cache --upgrade pip setuptools
|
||||||
|
|
||||||
|
USER app
|
||||||
|
|
||||||
|
# install dependencies
|
||||||
|
COPY package.json .
|
||||||
|
COPY package-lock.json .
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# build app
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM nginx:1.23.2-alpine AS runner
|
||||||
|
|
||||||
|
RUN addgroup -S www && adduser -S www -G www
|
||||||
|
|
||||||
|
# copy build files
|
||||||
|
COPY --from=builder /home/app/dist /usr/share/nginx/html
|
7
docker-compose.yml
Normal file
7
docker-compose.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build: .
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
Loading…
Reference in New Issue
Block a user