server/docker: Rewrite how files are copied in Docker
This is in preperation of a future commit that will perform the unit tests in a docker container
This commit is contained in:
parent
0839dafd34
commit
9329717335
|
@ -1,8 +1,7 @@
|
||||||
szurubooru/tests/*
|
|
||||||
setup.cfg
|
|
||||||
.pylintrc
|
|
||||||
mypi.ini
|
|
||||||
|
|
||||||
Dockerfile
|
|
||||||
.dockerignore
|
|
||||||
**/.gitignore
|
**/.gitignore
|
||||||
|
.dockerignore
|
||||||
|
.pylintrc
|
||||||
|
Dockerfile
|
||||||
|
config.yaml
|
||||||
|
mypy.ini
|
||||||
|
setup.cfg
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
FROM scratch as approot
|
FROM busybox as approot
|
||||||
WORKDIR /opt/app
|
|
||||||
|
|
||||||
COPY alembic.ini wait-for-es generate-thumb ./
|
COPY . /opt/app/
|
||||||
COPY szurubooru/ ./szurubooru/
|
RUN \
|
||||||
COPY config.yaml.dist ./
|
# Remove unit tests from production release
|
||||||
|
rm -rf /opt/app/szurubooru/tests && \
|
||||||
|
# Remove requirements files, will be added later
|
||||||
|
rm -f /opt/app/requirements.txt && \
|
||||||
|
rm -f /opt/app/dev-requirements.txt
|
||||||
|
|
||||||
|
|
||||||
FROM python:3.6-slim
|
FROM python:3.6-slim
|
||||||
|
@ -38,7 +41,7 @@ COPY --chown=app:app requirements.txt ./requirements.txt
|
||||||
RUN pip3 install --no-cache-dir -r ./requirements.txt
|
RUN pip3 install --no-cache-dir -r ./requirements.txt
|
||||||
|
|
||||||
# done to minimize number of layers in final image
|
# done to minimize number of layers in final image
|
||||||
COPY --chown=app:app --from=approot / /
|
COPY --chown=app:app --from=approot /opt/app /opt/app/
|
||||||
|
|
||||||
VOLUME ["/data/"]
|
VOLUME ["/data/"]
|
||||||
EXPOSE ${PORT}
|
EXPOSE ${PORT}
|
||||||
|
|
Loading…
Reference in New Issue