split dev and prod docker stages

This commit is contained in:
len0rd 2023-06-08 10:29:27 -04:00
parent 4285425051
commit b52ddcb0d8
2 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,8 @@
{ {
"build": { "build": {
"context": "../", "context": "../",
"dockerfile": "../Dockerfile" "dockerfile": "../Dockerfile",
"target": "dev",
}, },
"forwardPorts": [8090] "forwardPorts": [8090]
} }

View file

@ -1,4 +1,4 @@
FROM python:3.11-bullseye FROM python:3.11-bullseye AS dev
ADD pip-requirements.txt /tmp/pip-requirements.txt ADD pip-requirements.txt /tmp/pip-requirements.txt
RUN pip install -r /tmp/pip-requirements.txt \ RUN pip install -r /tmp/pip-requirements.txt \
@ -21,9 +21,11 @@ RUN apt update \
&& rm -rf drawio-amd64-${DRAWIO_VERSION}.deb && rm -rf drawio-amd64-${DRAWIO_VERSION}.deb
ENV XVFB_DISPLAY ":42" ENV XVFB_DISPLAY ":42"
FROM dev as prod
# Bundle app source # Bundle app source
# COPY . . COPY . .
# RUN ablog build RUN ablog build
EXPOSE 8090 EXPOSE 8090
CMD [ "ablog", "serve", "-p", "8090" ] CMD [ "ablog", "serve", "-p", "8090" ]