-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
103 additions
and
65 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM linkerry-base:latest AS builder | ||
FROM linkerry/base:latest AS builder | ||
|
||
ARG NODE_ENV | ||
ARG BUILD_FLAG | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Build images | ||
docker build -t linkerry/api -f ./apps/api-gateway/Dockerfile . --platform=linux/amd64 | ||
|
||
# Push docker image to container registry | ||
docker login -u "$CONTAINER_REGISTRY_USERNAME" -p "$CONTAINER_REGISTRY_PASSWORD" "$CONTAINER_REGISTRY_ADDRESS" | ||
|
||
docker tag linkerry/api registry.digitalocean.com/linkerry/api:"$ENV" | ||
docker push registry.digitalocean.com/linkerry/api:"$ENV" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,22 @@ version: '3.8' | |
|
||
services: | ||
api-gateway: | ||
container_name: api-gateway | ||
build: | ||
context: ./ | ||
cache_from: | ||
- linkerry-base:latest | ||
dockerfile: ./Dockerfile | ||
args: | ||
NODE_ENV: 'production' | ||
BUILD_FLAG: '' | ||
image: api-gateway:latest | ||
env_file: | ||
- ../../.env | ||
image: registry.digitalocean.com/linkerry/api:dev | ||
ports: | ||
- 3001:3001 | ||
- ${VIRTUAL_PORT}:${VIRTUAL_PORT} | ||
env_file: | ||
- .env | ||
environment: | ||
NODE_ENV: 'production' | ||
PORT: 3001 | ||
restart: on-failure | ||
- VIRTUAL_HOST=${VIRTUAL_HOST} | ||
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST} | ||
- [email protected] | ||
- VIRTUAL_PORT=${VIRTUAL_PORT} | ||
restart: unless-stopped | ||
redis: | ||
image: redis:alpine | ||
container_name: redis | ||
env_file: | ||
- ../../.env | ||
- .env | ||
command: redis-server --appendonly yes --replica-read-only no --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}" | ||
restart: always | ||
ports: | ||
|
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Build images | ||
docker build -t linkerry/web -f ./apps/web/Dockerfile . --platform=linux/amd64 --progress=plain | ||
|
||
# Push docker image to container registry | ||
docker login -u "$CONTAINER_REGISTRY_USERNAME" -p "$CONTAINER_REGISTRY_PASSWORD" "$CONTAINER_REGISTRY_ADDRESS" | ||
|
||
docker tag linkerry/web registry.digitalocean.com/linkerry/web:"$ENV" | ||
docker push registry.digitalocean.com/linkerry/web:"$ENV" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,17 @@ | ||
version: '3.8' | ||
|
||
services: | ||
web: | ||
container_name: web | ||
build: | ||
context: ./ | ||
cache_from: | ||
- linkerry-base:latest | ||
dockerfile: ./Dockerfile | ||
args: | ||
NODE_ENV: 'production' | ||
BUILD_FLAG: '' | ||
image: web:latest | ||
env_file: | ||
- ../../.env | ||
image: registry.digitalocean.com/linkerry/web:dev | ||
ports: | ||
- 3000:3000 | ||
- ${VIRTUAL_PORT}:${VIRTUAL_PORT} | ||
env_file: | ||
- .env | ||
environment: | ||
NODE_ENV: 'production' | ||
networks: | ||
- proxy | ||
restart: on-failure | ||
|
||
volumes: | ||
redis: | ||
driver: local | ||
- VIRTUAL_HOST=${VIRTUAL_HOST} | ||
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST} | ||
- [email protected] | ||
- VIRTUAL_PORT=${VIRTUAL_PORT} | ||
restart: unless-stopped | ||
|
||
networks: | ||
default: | ||
|
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Run loccally `nx run web:docker-compose` | ||
|
||
Connect to server `ssh [email protected]` | ||
|
||
Install docker `https://docs.docker.com/engine/install/ubuntu/` | ||
|
||
|
||
Setup proxy | ||
`git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-automation.git proxy` | ||
`cd proxy/bin && ./fresh-start.sh --yes --skip-docker-image-check -e [email protected]` | ||
test | ||
`./test.sh api.linkerry.com` | ||
|
||
Create dir like a domaina: `mkdir api.linkerry.com` | ||
|
||
Create docker-compose file: `cd api.linkerry.com && touch docker-compose.yml` | ||
|
||
Copy and create env file | ||
|
||
Login to docker container registry | ||
`docker login -u "$CONTAINER_REGISTRY_USERNAME" -p "$CONTAINER_REGISTRY_PASSWORD" "$CONTAINER_REGISTRY_ADDRESS"` | ||
|
||
Docker compose: | ||
``` | ||
version: '3.8' | ||
services: | ||
web: | ||
image: registry.digitalocean.com/linkerry/web:dev | ||
ports: | ||
- ${VIRTUAL_PORT}:${VIRTUAL_PORT} | ||
env_file: | ||
- .env | ||
environment: | ||
- VIRTUAL_HOST=${VIRTUAL_HOST} | ||
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST} | ||
- [email protected] | ||
- VIRTUAL_PORT=${VIRTUAL_PORT} | ||
restart: unless-stopped | ||
networks: | ||
default: | ||
external: | ||
name: ${NETWORK:-proxy} | ||
``` | ||
|
||
start docker compose | ||
`docker compose -f ./docker-compose.yml up -d` |
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
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
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