Skip to content

Commit 7489a2d

Browse files
committed
Fix compose-stack
Compose stack only used for local development
1 parent 5a117c2 commit 7489a2d

File tree

5 files changed

+33
-17
lines changed

5 files changed

+33
-17
lines changed

app/container/containerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,21 @@ FROM shared-project-dependencies AS development-project-dependencies
3838
RUN micropipenv install --dev --method pipenv
3939

4040
COPY ./src/ ./
41+
42+
FROM ${build_environment}-project-dependencies AS shared-post-project-dependencies
43+
44+
45+
46+
FROM shared-post-project-dependencies AS production-post-project-dependencies
47+
48+
49+
50+
FROM shared-post-project-dependencies AS development-post-project-dependencies
51+
52+
53+
54+
FROM ${build_environment}-post-project-dependencies AS shared-entrypoint
55+
56+
# The base-image ENTRYPOINT is set to: python
57+
WORKDIR /usr/src/app/
58+
CMD run.py

compose.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ services:
88
context: ./app/
99
dockerfile: ./containerfile
1010
args:
11-
image_variant: development
11+
image_variant: development
12+
environment:
13+
APPLICATION_ENVIRONMENT: DEVELOPMENT
14+
APPLICATION_HOST: '0.0.0.0'
15+
APPLICATION_PORT: 80
1216
volumes:
13-
# Source volume for live development from the host
17+
# Source code volume for live development from the host
1418
- ./src/:/usr/src/app/:Z
1519
ports:
1620
- 80:80
@@ -24,26 +28,20 @@ services:
2428
context: ./database/
2529
dockerfile: ./containerfile
2630
args:
27-
image_variant: development
31+
image_variant: development
2832
environment:
29-
MYSQL_USER: movieapp
30-
MYSQL_PASSWORD: hello1234
31-
MYSQL_ROOT_PASSWORD: test1234
32-
MYSQL_DATABASE: movieapp
33-
volumes:
34-
- ./mysql/data:/var/lib/mysql
35-
ports:
36-
- 3306:3306
33+
MYSQL_USER: movie_app
34+
MYSQL_PASSWORD: movie_app1234
35+
MYSQL_ROOT_PASSWORD: root1234
36+
MYSQL_DATABASE: movie_manager
3737
volumes:
3838
# Database conf files
3939
- ./conf.d/mysql.cnf:/etc/mysql/conf.d/mysql.cnf:Z
4040
# Sql files to initialize the server with
4141
- ./initdb/:/docker-entrypoint-initdb.d/:Z
4242
# Additional sql files
4343
- ./sql/:/usr/src/sql/:Z
44-
# Database data storage
44+
# Persist database data to host
4545
- ./dbdata/:/var/lib/mysql/:Z
46-
environment:
47-
- MYSQL_ROOT_PASSWORD=pass
4846
ports:
4947
- 3306:3306

database/.containerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
data/.gitkeep
1+
dbdata/.gitkeep

database/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Ignore the contents of the data directory
22
# and only keep that directory checked-in
3-
data/*
4-
!data/.gitkeep
3+
dbdata/*
4+
!dbdata/.gitkeep
File renamed without changes.

0 commit comments

Comments
 (0)