Skip to content

Commit

Permalink
Merge pull request xtekky#69 from editor-syntax/patch-1
Browse files Browse the repository at this point in the history
feat: Podman as a Docker alternative
  • Loading branch information
xtekky committed Apr 30, 2023
2 parents b49e128 + 75945d5 commit f016491
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions podman-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build stage
podman build -t build-stage -f - . << EOF
FROM python:3.8-alpine AS build
WORKDIR /app
COPY requirements.txt requirements.txt
RUN apk add --no-cache build-base && \
pip3 install --user --no-cache-dir -r requirements.txt
COPY . .
EOF

# Save the build-stage container ID.
build_container_id=$(podman ps -a | grep build-stage | awk '{print $1}')

# Production stage
podman build -t production-stage -f - . << EOF
FROM python:3.8-alpine AS production
WORKDIR /app
COPY --from=$build_container_id /root/.local /root/.local
COPY . .
ENV PATH=/root/.local/bin:$PATH
CMD ["python3", "./run.py"]
EOF

0 comments on commit f016491

Please sign in to comment.