Compare commits

...
16 Commits
Author SHA1 Message Date
marc 80aa16c844 new ports 2022-09-21 16:25:45 +02:00
marc 51eeb3d000 Merge remote-tracking branch 'origin/docker-compose' into front-multistage 2022-09-21 16:20:32 +02:00
marc 08f70a7a61 ci 2022-09-21 11:03:09 +02:00
marc e844eafd41 opt/numeris 2022-09-21 10:40:50 +02:00
marc def2fc0335 nginx.conf 2022-09-21 10:37:25 +02:00
marc ec4a85ecbe nginx 2022-09-21 10:36:47 +02:00
marc 694f0b0d25 multistage 2022-09-21 10:32:33 +02:00
marc b54c69ae4c names are back 2022-09-20 15:18:09 +02:00
marc ce259181b9 mysql_testing 2022-09-20 14:38:33 +02:00
marc 77ca1911ed bind mount is back 2022-09-20 14:36:31 +02:00
marc 5e3dfec004 phpmyadmin might come in handy 2022-09-19 10:32:09 +02:00
marc b834f1d27b fix names 2022-09-19 10:27:59 +02:00
marc 3a374a10bc front too 2022-09-17 17:51:40 +02:00
marc 0378a0a224 front too 2022-09-16 19:54:08 +02:00
marc a6b9888cfe production 2022-09-16 19:06:08 +02:00
marc 8f69143715 3.9 2022-09-16 18:43:11 +02:00
4 changed files with 81 additions and 35 deletions
+23 -21
View File
@@ -1,42 +1,44 @@
version: '3'
version: "3.9"
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
restart: unless-stopped
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
container_name: numeris_phpmyadmin
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: 'numeris'
container_name: numeris_mysql
restart: unless-stopped
env_file:
- .env
volumes:
- ./var/mysql:/var/lib/mysql
container_name: numeris_mysql
back:
container_name: numeris_back
restart: unless-stopped
build:
context: ./back
dockerfile: Dockerfile.production
environment:
APP_ENV: production
APP_DEBUG: 'false'
DB_CONNECTION: mysql
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
ports:
- ${BACK_PORT}:80
links:
- mysql
dockerfile: Dockerfile
env_file:
- .env
depends_on:
- mysql
container_name: numeris_back
front:
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile
depends_on:
- back
volumes:
mysql:
+26 -2
View File
@@ -1,14 +1,27 @@
version: '3'
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: numeris_phpmyadmin
ports:
- 3000:80
links:
- mysql:db
depends_on:
- mysql
volumes:
- ./var/mysql_testing:/var/lib/mysql
mysql:
image: mysql:5.7
container_name: numeris_mysql
environment:
MYSQL_DATABASE: 'numeris_testing'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
container_name: numeris_mysql
back:
container_name: numeris_back
build:
context: ./back
dockerfile: Dockerfile
@@ -25,4 +38,15 @@ services:
- mysql
depends_on:
- mysql
container_name: numeris_back
front:
container_name: numeris_front
build:
context: ./front
dockerfile: Dockerfile
ports:
- 8000:80
links:
- back
depends_on:
- back
+13 -12
View File
@@ -1,16 +1,17 @@
FROM node:11.15.0
WORKDIR /home/numeris
ENV PATH /home/numeris/node_modules/.bin:$PATH
COPY package*.json /home/numeris/
# npm install
RUN npm install
FROM node:11.15.0 as builder
WORKDIR /opt/numeris
ENV PATH /opt/numeris/node_modules/.bin:$PATH
COPY package*.json /opt/numeris/
RUN npm ci
RUN npm install -g @angular/cli@7.3.9
COPY . .
RUN npm rebuild node-sass
RUN npm run build-prod
ENTRYPOINT [ "ng", "s", "--host", "0.0.0.0" ]
FROM nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /opt/numeris/dist /usr/share/nginx/html
EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]
+19
View File
@@ -0,0 +1,19 @@
server {
listen 80;
sendfile on;
default_type application/octet-stream;
gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 1100;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html =404;
}
}