Copy from .env.dist
to .env.local
and set your environment variables
$ cp .env.dist .env
$ cp ./api/.env.dist ./api/.env.local
$ cp ./client/.env.dist ./client/.env.local
$ openssl req -x509 -nodes -days 365 -newkey rsa:4096 \
> -keyout ./client/ssl/certs/server.key \
> -out ./client/ssl/certs/server.crt
$ openssl req -x509 -nodes -days 365 -newkey rsa:4096 \
> -keyout ./api/certificates/server.key \
> -out ./api/certificates/server.crt
$ docker-compose up -d
$ docker-compose start [container_name]
$ docker-compose stop [container_name]
$ docker-compose down
$ docker exec -it [container_name]
##> mongosh "mongodb://database:27017" --username [username] --authenticationDatabase admin
Build images with this command:
$ docker-compose -f docker-compose.build.yml build
If you want to target a specific stage of an image in the Dockerfile
# docker -f docker-compose.build.yml build --target [STAGE_NAME] -t [TAGNAME]
$ docker -f docker-compose.build.yml build --target dev -t username/project_name:tag
docker
#####2. Push images to repository
$ docker-compose -f docker-compose.build.yml push
#####1. Upload assets to dist folder Connect to your server and create a remote directory where to place your configuration files and upload files necessary to create containers in dist server folder. These commands above are made from local machine, to copy files or directory from local to a remote server using security key or basic authentication.
$ scp [options] ./docker-compose.prod.yml [user@host]:remote_path/docker-compose.prod.yml
$ scp -i local_path/key.ext -rp [options] ./docker/prod [user@host]:remote_path/docker/prod