forked from Laboratoria/LIM013-fe-burger-queen-api
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
60 lines (60 loc) · 1.83 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: "3"
services:
db:
# TODO: configura tu imagen de base de datos, te recomendamos una de las sgtes:
# https://hub.docker.com/_/mysql
# https://hub.docker.com/_/mongo
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_DATABASE: 'burguerqueen'
# So you don't have to use root, but you can if you liked
MYSQL_USER: 'useradmin'
# You can use whatever password you like
MYSQL_PASSWORD: 'Eruliz1987.'
# Password for root access
MYSQL_ROOT_PASSWORD: 'Eruliz1987.'
ports:
# <Port exposed> : < MySQL Port running inside container>
- '3306:3306'
expose:
# Opens port 3306 on the container
- '3306'
# Where our data will be persisted
volumes:
- my-db:/var/lib/mysql
networks:
- private
node:
depends_on:
- db
image: "node:10" # https://hub.docker.com/_/node/
user: "node"
working_dir: /home/node/app
environment:
- NODE_ENV=production
- PORT=8080
- DB_URL="Server=8.8.8.6;Uid=useradmin;Pwd=Eruliz1987.;Database=burguerqueen;Port=3306"
env_file:
- secrets.env # los _secrets_ a incluir como variables de entorno. Usa el archivo `sample.secrets.env` como guia
volumes:
- ./:/home/node/app # montamos el codigo en el HOME del usuario _node_
expose:
- "8080" # nuestra app corre en el puerto 8080
ports:
- "80:8080" # mapeamos el puerto 8080 de nuestro contenedor al puerto 80 de nuestra maquina
command: "bash -c 'rm -rf node_modules && npm install && npm start'" # reinstalamos las dependencias y levantamos el servidor
depends_on:
- db
networks:
- public
- private
# Names our volume
volumes:
my-db:
networks:
public:
internal: false
private:
internal: true