aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorShyam Sunder2019-07-27 14:34:58 -0400
committerShyam Sunder2019-07-27 14:34:58 -0400
commit9329717335abdff9f6966957579ab5d8051612fc (patch)
treebc335380014c1383234d1b59e6efc03ded130875 /server
parent0839dafd34bc96d9687a5e955153f66e2c464c23 (diff)
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
Diffstat (limited to 'server')
-rw-r--r--server/.dockerignore11
-rw-r--r--server/Dockerfile15
2 files changed, 14 insertions, 12 deletions
diff --git a/server/.dockerignore b/server/.dockerignore
index a20ffa9..539365f 100644
--- a/server/.dockerignore
+++ b/server/.dockerignore
@@ -1,8 +1,7 @@
-szurubooru/tests/*
-setup.cfg
+**/.gitignore
+.dockerignore
.pylintrc
-mypi.ini
-
Dockerfile
-.dockerignore
-**/.gitignore
+config.yaml
+mypy.ini
+setup.cfg
diff --git a/server/Dockerfile b/server/Dockerfile
index dd5bd5a..0b0664d 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -1,9 +1,12 @@
-FROM scratch as approot
-WORKDIR /opt/app
+FROM busybox as approot
-COPY alembic.ini wait-for-es generate-thumb ./
-COPY szurubooru/ ./szurubooru/
-COPY config.yaml.dist ./
+COPY . /opt/app/
+RUN \
+ # 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
@@ -38,7 +41,7 @@ COPY --chown=app:app requirements.txt ./requirements.txt
RUN pip3 install --no-cache-dir -r ./requirements.txt
# 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/"]
EXPOSE ${PORT}

© 2015 - 2026 Jakob L. Kreuze