Skip to content

Commit

Permalink
docker config for staging environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin POCHAT authored and Benjamin POCHAT committed Feb 21, 2021
1 parent 1dc6ddf commit 4b189f2
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 2 deletions.
46 changes: 46 additions & 0 deletions docker-compose-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: '3.7'
services:

database:
image: postgres:12.2-alpine
networks:
- hostnet
volumes:
- /var/lib/postgresql/data/pgdata:/var/lib/postgresql/data/pgdata
environment:
- POSTGRES_USER=localeat
- POSTGRES_PASSWORD=localeat
- PGDATA=/var/lib/postgresql/data/pgdata

core:
build:
context: "."
dockerfile: ./core/Dockerfile
image: benjaminpochat/localeat-core-staging:${DOCKER_IMAGE_TAG:-latest}
networks:
- hostnet
depends_on:
- database
environment:
- localeat_datasource_url=jdbc:postgresql://localhost:5432/localeat
- localeat_datasource_username=localeat
- localeat_datasource_password=localeat
- [email protected]
- localeat_smtp_password=localeat

ui:
build:
context: "."
dockerfile: ./ui/Dockerfile
image: benjaminpochat/localeat-ui-staging:${DOCKER_IMAGE_TAG:-latest}
networks:
- hostnet
depends_on:
- core
environment:
- localeat_environment_type=staging

networks:
hostnet:
external: true
name: host
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ services:
- hostnet
depends_on:
- core
environment:
- localeat_environment_type=production

networks:
hostnet:
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions scripts/staging/build/build-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export DOCKER_IMAGE_TAG=latest
docker-compose -f docker-compose-staging.yml build

1 change: 1 addition & 0 deletions scripts/staging/run/remove-stack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker stack rm localeat-staging
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions scripts/staging/run/update-stack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker-compose pull
docker stack deploy -c docker-compose.yml localeat-staging
2 changes: 1 addition & 1 deletion ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apk update
WORKDIR /app
COPY ./ui .
RUN cd /app && npm set progress=false && npm install
RUN npm run build -- --configuration production
RUN npm run build -- --configuration ${localeat_environment_type}

# STEP 2 build an apache image with static website
FROM httpd:2.4.41-alpine
Expand Down
2 changes: 1 addition & 1 deletion ui/src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const environment = {
production: false,
localeatCoreUrl: 'http://vps695750.ovh.net:8080'
localeatCoreUrl: 'http://localhost:8080'
};

0 comments on commit 4b189f2

Please sign in to comment.