forked from simple-login/app
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.multiarch
50 lines (39 loc) · 1.43 KB
/
Dockerfile.multiarch
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
47
48
49
#https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
#ARG QEMU_ARCH=x86_64
#ARG TARGET_ARCH=amd64
#FROM multiarch/qemu-user-static:x86_64-$QEMU_ARCH AS qemu
#FROM $TARGET_ARCH/nginx:alpine
#ARG QEMU_ARCH=x86_64
#Copy architecture emulation static binary
#COPY --from=qemu /usr/bin/qemu-$QEMU_ARCH-static /usr/bin
# Install npm packages
ARG TARGET_ARCH=amd64
FROM $TARGET_ARCH/node:10.17.0-alpine AS npm
ARG QEMU_ARCH=x86_64
# Copy downloaded architecture emulation static binary
COPY qemu-$QEMU_ARCH-static /usr/bin/
RUN echo "DEBUG QEMU_ARCH=$QEMU_ARCH"
WORKDIR /code
COPY ./static/package*.json /code/static/
RUN cd /code/static && npm install
# Main image
FROM $TARGET_ARCH/python:3.7-alpine
ARG QEMU_ARCH
# Copy downloaded architecture emulation static binary
COPY qemu-$QEMU_ARCH-static /usr/bin/
RUN echo "DEBUG QEMU_ARCH=$QEMU_ARCH"
# install some utility packages
RUN apk update && apk add --no-cache vim busybox-extras build-base libffi-dev libressl-dev musl-dev postgresql-dev python3-dev gnupg
RUN pip3 install poetry==1.0.10
# install dependencies
WORKDIR /code
COPY poetry.lock pyproject.toml ./
RUN poetry config virtualenvs.create false \
&& poetry install
# copy npm packages
COPY --from=npm /code /code
# copy everything else into /code
COPY . .
EXPOSE 7777
#gunicorn wsgi:app -b 0.0.0.0:7777 -w 2 --timeout 15 --log-level DEBUG
CMD ["gunicorn","wsgi:app","-b","0.0.0.0:7777","-w","2","--timeout","15"]