Skip to content

Instantly share code, notes, and snippets.

@Kaperskyguru
Created July 8, 2023 21:51
Show Gist options
  • Save Kaperskyguru/f5ead8bc3bbeba931c5e880cb77a9fdd to your computer and use it in GitHub Desktop.
Save Kaperskyguru/f5ead8bc3bbeba931c5e880cb77a9fdd to your computer and use it in GitHub Desktop.
version: "3.5"
services:
api:
build:
context: .
dockerfile: Dockerfile
args:
PACKAGE_PATH: api
WORKING_DIR: /usr/src/
expose:
- 8000
ports:
- 8000:8000
environment:
- NODE_ENV=development
- TOKEN_SECRET=mYsEcReT
- PORT=8000
- TOKEN=eyJhbGciOiJIUzI1NiJ9.c29sb21vbg.WsTPoPpKhR7fFW0KsfN0A3II5M_iKLPpbnV2OOJOKcc
- BASE_URL=http://api:8000
env_file:
- ./common.env
volumes:
- ./api:/usr/src
depends_on:
- postgres
command: >
sh -c "npm install knex -g &&
npx knex migrate:latest &&
npx knex seed:run &&
npm start &&
npm test"
frontend:
build:
context: .
dockerfile: Dockerfile
args:
PACKAGE_PATH: frontend
WORKING_DIR: /usr/src/
expose:
- 3000
ports:
- 3000:3000
environment:
- REACT_APP_ENV=production
- REACT_APP_BACKEND=http://0.0.0.0:8000/graphql
- NODE_PATH=/usr/src/
- REACT_APP_TOKEN=eyJhbGciOiJIUzI1NiJ9.c29sb21vbg.WsTPoPpKhR7fFW0KsfN0A3II5M_iKLPpbnV2OOJOKcc
env_file:
- ./common.env
volumes:
- ./frontend:/usr/src
depends_on:
- api
command: ["npm", "start"]
postgres:
image: postgres
restart: always
env_file: ./common.env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment