Skip to content

Commit

Permalink
Remove dependency to make in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Kévin Liagre committed Mar 20, 2024
1 parent 25aa35d commit 25defe3
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ version: "3.7"
services:
api:
build:
context: .
dockerfile: dev_api.Dockerfile
context: ./docker
dockerfile: Dockerfile.dev
depends_on:
- postgresql
- elasticsearch
Expand Down Expand Up @@ -37,7 +37,7 @@ services:
POSTGRES_PASSWORD: test
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgresql.conf:/etc/postgresql.conf
- ./docker/conf/postgresql.conf:/etc/postgresql.conf
- .:/v6_api
command: ["postgres", "-c", "config_file=/etc/postgresql.conf"]

Expand Down
7 changes: 2 additions & 5 deletions Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ RUN set -x \
git

RUN set -x \
&& make -f config/dev install \
&& py3compile -f .build/venv/ \
&& rm -fr .cache \
&& apt-get -y purge \
&& apt-get -y --purge autoremove \
&& apt-get clean \
Expand All @@ -55,8 +52,8 @@ ARG VERSION
ENV version=$VERSION \
PATH=/var/www/.build/venv/bin/:$PATH

COPY /docker-entrypoint.sh /
COPY /docker-entrypoint.d/* /docker-entrypoint.d/
COPY /docker/docker-entrypoint.sh /
COPY /docker/docker-entrypoint.d/prod/* /docker-entrypoint.d/
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 8080
Expand Down
8 changes: 3 additions & 5 deletions dev_api.Dockerfile → docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ RUN set -x \
git

RUN set -x \
&& make -f config/docker-dev install \
&& make -f config/docker-dev .build/dev-requirements.timestamp \
&& py3compile -f .build/venv/ \
&& rm -fr .cache \
&& apt-get -y purge \
&& apt-get -y --purge autoremove \
&& apt-get clean \
Expand All @@ -53,4 +49,6 @@ RUN set -x \
ENV version='' \
PATH=/var/www/.build/venv/bin/:$PATH

RUN make -f config/docker-dev template
COPY /docker/docker-entrypoint.sh /
COPY /docker/docker-entrypoint.d/dev/* /docker-entrypoint.d/
ENTRYPOINT ["/docker-entrypoint.sh"]
File renamed without changes.
8 changes: 8 additions & 0 deletions docker/docker-entrypoint.d/dev/10-run-make-cmds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -ex

cd /var/www
make -f config/docker-dev install
make -f config/docker-dev .build/dev-requirements.timestamp
py3compile -f .build/venv/
rm -fr .cache
make -f config/docker-dev template
File renamed without changes.
6 changes: 6 additions & 0 deletions docker/docker-entrypoint.d/prod/20-run-make-cmds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh -ex

cd /var/www
make -f config/dev install
py3compile -f .build/venv/
rm -fr .cache
File renamed without changes.

0 comments on commit 25defe3

Please sign in to comment.