Moved development stuff to docker-compose

This commit is contained in:
Jef Roosens 2021-04-17 16:04:04 +02:00
parent 00bf8501dd
commit 43e26191cc
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
5 changed files with 112 additions and 118 deletions

View file

@ -7,4 +7,3 @@ COPY --chown=builder:builder ./docker/entrypoint_dev.sh /entrypoint.sh
COPY --chown=builder:builder ./Rocket.toml /app/Rocket.toml
ENTRYPOINT ["/entrypoint.sh"]
CMD ["run", "--bin", "server"]

View file

@ -0,0 +1,31 @@
version: '2.4'
services:
app:
build:
# Make sure the build context is one directory up
context: '..'
dockerfile: './docker/Dockerfile.dev'
image: 'chewingbever/fej:dev'
restart: 'no'
container_name: 'fej_app'
volumes:
- 'build-cache:/app/target'
- 'registry-cache:/app/.cargo/registry'
ports:
- '8000:8000'
command: "${CMD}"
db:
container_name: 'fej_db'
restart: 'no'
# the devop environment exposes the database so we can use the Diesel cli
ports:
- '5432:5432'
volumes:
build-cache:
registry-cache:

View file

@ -2,13 +2,13 @@ version: '2.4'
services:
app:
build:
context: '..'
dockerfile: 'docker/Dockerfile.rel'
image: 'chewingbever/fej:latest'
restart: 'always'
depends_on:
db:
condition: 'service_healthy'
environment:
- 'DATABASE_URL=postgres://fej:fej@db:5432/fej'