Browse Source

added arguments for backend; added image names

tags/v0.1.0^0
Robin Thoni 8 years ago
parent
commit
0571410088
2 changed files with 13 additions and 6 deletions
  1. 5
    4
      backend/Dockerfile
  2. 8
    2
      docker-compose.yml

+ 5
- 4
backend/Dockerfile View File

4
 
4
 
5
 COPY ./backend/ /tmp/backend/
5
 COPY ./backend/ /tmp/backend/
6
 
6
 
7
-ENV WEBAPI_PROJECT WebTest
8
-ENV BUILD_CONFIG Release
7
+ARG WEBAPI_PROJECT=WebApi
8
+ARG BUILD_CONFIG=Release
9
 
9
 
10
-RUN cd /tmp/backend && \
10
+RUN echo "Building ${WEBAPI_PROJECT} in ${BUILD_CONFIG} configuration" && \
11
+    cd /tmp/backend && \
11
     dotnet restore && \
12
     dotnet restore && \
12
     mkdir /var/www && \
13
     mkdir /var/www && \
13
     cd /tmp/backend/${WEBAPI_PROJECT} && \
14
     cd /tmp/backend/${WEBAPI_PROJECT} && \
14
-    dotnet publish --output /var/www && \
15
+    dotnet publish --configuration "${BUILD_CONFIG}" --output /var/www && \
15
     ln -s /var/www/${WEBAPI_PROJECT}.dll /var/www/__RUN_ME.DLL &&\
16
     ln -s /var/www/${WEBAPI_PROJECT}.dll /var/www/__RUN_ME.DLL &&\
16
     rm /tmp/backend -rf
17
     rm /tmp/backend -rf
17
 
18
 

+ 8
- 2
docker-compose.yml View File

3
 services:
3
 services:
4
     postgresql:
4
     postgresql:
5
         build: ./postgresql
5
         build: ./postgresql
6
+        image: project-luticate2-postgresql-image:dev
6
         container_name: project-luticate2-postgresql
7
         container_name: project-luticate2-postgresql
7
         networks:
8
         networks:
8
             project.internal.docker:
9
             project.internal.docker:
17
 
18
 
18
     frontend:
19
     frontend:
19
         build: ./frontend
20
         build: ./frontend
21
+        image: project-luticate2-frontend-image:dev
20
         container_name: project-luticate2-frontend
22
         container_name: project-luticate2-frontend
21
         networks:
23
         networks:
22
             project.internal.docker:
24
             project.internal.docker:
28
             - env
30
             - env
29
 
31
 
30
     backend:
32
     backend:
31
-        build: ./backend
33
+        build:
34
+            context: ./backend
35
+            args:
36
+                - WEBAPI_PROJECT=WebApiUtils
37
+                - BUILD_CONFIG=Release
38
+        image: project-luticate2-backend-image:dev
32
         container_name: project-luticate2-backend
39
         container_name: project-luticate2-backend
33
         networks:
40
         networks:
34
             project.internal.docker:
41
             project.internal.docker:
37
         env_file:
44
         env_file:
38
             - env
45
             - env
39
 
46
 
40
-
41
 networks:
47
 networks:
42
     project.internal.docker:
48
     project.internal.docker:

Loading…
Cancel
Save