Created
May 2, 2022 14:50
-
-
Save joaobispo2077/3a159f45a7c5cb022e8942eb9fa0e677 to your computer and use it in GitHub Desktop.
Dockerfile with build proxy and set proxy into container of an api.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
api: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
args: | |
http_proxy: "http://xxx.xx.xx.xxx:3128" | |
https_proxy: "http://xxx.xx.xx.xxx:3128" | |
all_proxy: "http://xxx.xx.xx.xxx:3128" | |
ALL_PROXY: "http://xxx.xx.xx.xxx:3128" | |
container_name: api | |
environment: | |
- https_proxy=http://xxx.xx.xx.xxx:3128 | |
- all_proxy=http://xxx.xx.xx.xxx:3128 | |
- ALL_PROXY=http://xxx.xx.xx.xxx:3128 | |
- HTTPS_PROXY=http://xxx.xx.xx.xxx:3128 | |
- HTTP_PROXY=http://xxx.xx.xx.xxx:3128 | |
- PORT=3333 | |
ports: | |
- '3333:3333' | |
working_dir: /opt/api | |
links: | |
- database | |
depends_on: | |
- database | |
command: npm run start:dev | |
database: | |
container_name: database | |
image: mysql:8.0.28 | |
hostname: mysql | |
environment: | |
MYSQL_DATABASE: ${DATABASE_SCHEMA} | |
MYSQL_USER: ${DATABASE_USER} | |
# MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD} | |
MYSQL_PASSWORD: ${DATABASE_PASSWORD} | |
ports: | |
- "${DATABASE_PORT}:${DATABASE_PORT}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment