-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
41 lines (30 loc) · 859 Bytes
/
Dockerfile
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
### Compile js
from node:alpine as jsbuilder
WORKDIR /js
RUN mkdir -p /app/assets/js
# Copy js code and dependencies
COPY ./js /js
# install dependecies
RUN yarn install
# build js
RUN yarn build-production
### actual image
# Pull base image
FROM python:3.8-alpine
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
WORKDIR /pegelinux
# Install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt /pegelinux/requirements.txt
RUN apk update && \
apk add postgresql-libs bash && \
apk add --virtual .build-deps gcc musl-dev postgresql-dev libffi-dev binutils libc-dev && \
pip install -r requirements.txt && \
apk --purge del .build-deps
# Copy project
COPY . /pegelinux/
# copy application js
COPY --from=jsbuilder /app/assets/js/application.js /code/app/assets/js/application.js