Skip to content

Commit

Permalink
feat: improve Dockerfile (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisson authored Dec 11, 2023
1 parent b6ee882 commit 866411e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
##### Builder Stage #####
FROM python:3.12-slim-bookworm as builder
##### Base Stage #####
FROM python:3.12-slim-bookworm as base

# Set default path
ENV PATH="/app/.venv/bin:${PATH}"

##### Builder Stage #####
FROM base as builder

# Set default workdir
WORKDIR /app

Expand All @@ -21,20 +24,13 @@ COPY templates ./templates
COPY static ./static

##### Final Stage #####
FROM python:3.12-slim-bookworm

# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive

# Set default path
ENV PATH="/app/.venv/bin:${PATH}"
ENV PYTHONPATH /app
FROM base

# Copy content from builder stage
COPY --from=builder /app /app

# Add qrcode user and create directories
RUN useradd -m qrcode && mkdir -p /app
RUN useradd -m qrcode

# Set permissions
RUN chown -R qrcode:qrcode /app
Expand Down

0 comments on commit 866411e

Please sign in to comment.