multistage build, with docker compose
This commit is contained in:
parent
d479f7afd0
commit
0f47977804
22
Dockerfile
22
Dockerfile
@ -1,18 +1,12 @@
|
|||||||
# specify the node base image with your desired version node:<version>
|
# specify the node base image with your desired version node:<version>
|
||||||
FROM node:16
|
FROM node:16 as build
|
||||||
# replace this with your application's default port
|
|
||||||
RUN apt-get update && apt-get install -y p7zip-full && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
copy ./ /app
|
copy ./ /app
|
||||||
#RUN git clone https://gitea.simonzeyer.de/schuelerlabor-cleverlab/smarti.git /app
|
RUN npm install --verbose
|
||||||
|
RUN npm run build --verbose
|
||||||
#RUN chmod -R 777 /app
|
|
||||||
EXPOSE 3000
|
|
||||||
ENV HOST='0.0.0.0'
|
|
||||||
ARG HOST='0.0.0.0'
|
|
||||||
RUN npm install --global serve
|
|
||||||
RUN npm install
|
|
||||||
# RUN npm install
|
|
||||||
CMD ["serve", "build", "-s"]
|
|
||||||
|
|
||||||
|
FROM nginx:alpine
|
||||||
|
COPY --from=build /app/build/ /usr/share/nginx/html
|
||||||
|
RUN chmod 755 /usr/share/nginx/html/ -rf
|
||||||
|
EXPOSE 80
|
||||||
|
ENTRYPOINT ["sh", "-c", "cd /usr/share/nginx/html/ && nginx -g 'daemon off;'"]
|
@ -1,8 +1,11 @@
|
|||||||
# docker-compose.yml
|
# docker-compose.yml
|
||||||
services:
|
services:
|
||||||
smarti:
|
smarti:
|
||||||
|
mem_limit: 2048m
|
||||||
|
mem_reservation: 128M
|
||||||
|
cpus: 2
|
||||||
build:
|
build:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "3000"
|
- "80"
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user