Skip to content

Commit

Permalink
edit deploy with nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
katelovestocode committed Dec 26, 2023
1 parent 087276d commit 3b8db4f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
6 changes: 5 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ REFRESH_SECRET_KEY=
ACTION_SECRET_KEY=

AUTH0_AUDIENCE=
AUTH0_ISSUER_URL=
AUTH0_ISSUER_URL=
AUTH0_JWKS_URL=

REDIS_PASSWORD=
REDIS_URL=
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
script: |
set -x
cd app/backend-internship
git checkout BE-20-connect-to-AWS
git fetch origin
git reset --hard origin/BE-20-connect-to-AWS
git pull origin BE-20-connect-to-AWS
echo "PORT=${{ secrets.PORT }}" > .env
Expand All @@ -45,7 +46,10 @@ jobs:
echo "REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}" >> .env
echo "AUTH0_JWKS_URL=${{ secrets.AUTH0_JWKS_URL }}" >> .env
# docker-compose stop backend
# docker-compose rm -f backend
# sudo chmod -R 777 pgdata
# docker-compose up --build -d
cp /etc/ssl/private/certificate.crt certificate.crt
cp /etc/ssl/private/private.key private.key
docker-compose stop backend-fullstack
docker-compose rm -f backend-fullstack
docker-compose build backend-fullstack
docker-compose up --no-deps -d backend-fullstack
1 change: 1 addition & 0 deletions Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ WORKDIR /app
RUN npm run build

ENV PORT=3002

ENV HOSTNAME="0.0.0.0"

CMD [ "npm", "run", "start:prod" ]
1 change: 0 additions & 1 deletion Dockerfile.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ RUN mkdir -p /var/cache/nginx/client_temp
RUN mkdir -p /var/cache/nginx/proxy_temp
RUN mkdir -p /var/cache/nginx/fastcgi_temp

# Create the directory for Nginx cache
RUN chown -R nginxuser:nginxuser /var/cache/nginx

# Copy SSL certificates into the Docker image
Expand Down
12 changes: 3 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
db:
container_name: postgres-fullstack
image: postgres:14.0-alpine
restart: always
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
Expand All @@ -19,6 +20,7 @@ services:
dockerfile: Dockerfile.backend
depends_on:
- db
restart: unless-stopped
ports:
- '${PORT}:3002'
environment:
Expand All @@ -43,15 +45,7 @@ services:
- nginx_cache:/var/cache/nginx
user: 'nginxuser'
restart: always
# redis:
# image: redis
# ports:
# - '6379:6379'
# container_name: redis-cache
# environment:
# - REDIS_HOSTS=local:redis:6379
# volumes:
# - ./redis/data:/data
volumes:
postgres-data:
pgdata:
nginx_cache:

0 comments on commit 3b8db4f

Please sign in to comment.