From b52ddcb0d86de9030e2fb5f5583d01c6e316fa65 Mon Sep 17 00:00:00 2001 From: len0rd Date: Thu, 8 Jun 2023 10:29:27 -0400 Subject: [PATCH] split dev and prod docker stages --- .devcontainer/devcontainer.json | 3 ++- Dockerfile | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 934cd79..139c931 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,8 @@ { "build": { "context": "../", - "dockerfile": "../Dockerfile" + "dockerfile": "../Dockerfile", + "target": "dev", }, "forwardPorts": [8090] } diff --git a/Dockerfile b/Dockerfile index 17e457d..7e5e58d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-bullseye +FROM python:3.11-bullseye AS dev ADD pip-requirements.txt /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 ENV XVFB_DISPLAY ":42" +FROM dev as prod + # Bundle app source -# COPY . . -# RUN ablog build +COPY . . +RUN ablog build EXPOSE 8090 CMD [ "ablog", "serve", "-p", "8090" ]