Commit 19d64821 authored by John Wang's avatar John Wang

test: new dockerfile

parent 78e26f8b
...@@ -5,6 +5,7 @@ on: ...@@ -5,6 +5,7 @@ on:
branches: branches:
- 'main' - 'main'
- 'deploy/dev' - 'deploy/dev'
- 'test/new-dockerfile'
release: release:
types: [published] types: [published]
......
FROM python:3.10-slim # packages install stage
FROM python:3.10-slim AS base
LABEL maintainer="takatost@gmail.com" LABEL maintainer="takatost@gmail.com"
COPY requirements.txt /requirements.txt
RUN pip install --prefix=/pkg -r requirements.txt
# build stage
FROM python:3.10-slim AS builder
ENV FLASK_APP app.py ENV FLASK_APP app.py
ENV EDITION SELF_HOSTED ENV EDITION SELF_HOSTED
ENV DEPLOY_ENV PRODUCTION ENV DEPLOY_ENV PRODUCTION
...@@ -15,13 +23,12 @@ EXPOSE 5001 ...@@ -15,13 +23,12 @@ EXPOSE 5001
WORKDIR /app/api WORKDIR /app/api
RUN apt-get update && \ RUN apt-get update \
apt-get install -y bash curl wget vim gcc g++ python3-dev libc-dev libffi-dev nodejs && apt-get install -y --no-install-recommends bash curl wget vim gcc g++ python3-dev libc-dev libffi-dev nodejs \
&& apt-get autoremove \
COPY requirements.txt /app/api/requirements.txt && rm -rf /var/lib/apt/lists/*
RUN pip install -r requirements.txt
COPY --from=base /pkg /usr/local
COPY . /app/api/ COPY . /app/api/
COPY docker/entrypoint.sh /entrypoint.sh COPY docker/entrypoint.sh /entrypoint.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment