-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (32 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
46 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM python:3.10-slim
# Working dir
WORKDIR /app
ENV FLASK_CONFIG=config.DevelopmentConfig
ENV FLASK_APP=application.wsgi:app
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=5000
ENV FLASK_DEBUG=1
# install system deps
RUN apt-get update && \
apt-get install -y --no-install-recommends \
postgresql-client rsync make \
git curl build-essential libpq-dev bash && \
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
# Copy application source
COPY . .
# Install deps
# Install Node.js dependencies and build assets
RUN npm install
# Install Python dependencies
RUN python -m pip install --upgrade pip setuptools wheel && \
python -m pip install -r requirements/requirements.txt
EXPOSE 5000
RUN groupadd --system appuser && \
useradd --system --gid appuser --no-create-home appuser && \
chown -R appuser:appuser /app /venv
USER appuser
ENTRYPOINT ["sh", "-c", "flask db upgrade && flask run"]