Skip to content

Commit 7a47c13

Browse files
committed
Change .env for production deployment
1 parent e9e6058 commit 7a47c13

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

.deployignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
*.log
1717

1818
# Env (allow prod only if needed)
19-
!.env
19+
.env
20+
.env.*
21+
**/*.env

.github/workflows/deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
run: |
2727
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "echo ✅ SSH connection works!"
2828
29+
- name: Check .env file presence
30+
run: |
31+
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "test -f /opt/simradar21/env/.env && echo '✅ .env file exists' || (echo '❌ .env file is missing' && exit 1)"
32+
2933
- name: Copy files to VM
3034
run: |
3135
rsync -avz --delete \

docker/docker-compose.prod.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
image: postgres:18.1
44
container_name: sr21_postgres
55
restart: unless-stopped
6+
env_file:
7+
- ../env/.env
68
environment:
79
POSTGRES_USER: ${POSTGRES_USER}
810
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
@@ -22,6 +24,8 @@ services:
2224
image: redis:8.4.0
2325
container_name: sr21_redis
2426
restart: unless-stopped
27+
env_file:
28+
- ../env/.env
2529
environment:
2630
REDIS_PORT: ${REDIS_PORT}
2731
REDIS_PASSWORD: ${REDIS_PASSWORD}
@@ -42,6 +46,8 @@ services:
4246
context: ..
4347
dockerfile: packages/db/Dockerfile
4448
container_name: sr21_prisma
49+
env_file:
50+
- ../env/.env
4551
environment:
4652
POSTGRES_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public
4753
depends_on:
@@ -64,6 +70,8 @@ services:
6470
NEXT_PUBLIC_APP_VERSION: ${APP_VERSION}
6571
container_name: sr21_web
6672
restart: always
73+
env_file:
74+
- ../env/.env
6775
environment:
6876
NODE_ENV: production
6977
HOST: ${HOST}
@@ -91,6 +99,8 @@ services:
9199
dockerfile: apps/api/Dockerfile
92100
container_name: sr21_api
93101
restart: always
102+
env_file:
103+
- ../env/.env
94104
environment:
95105
NODE_ENV: production
96106
POSTGRES_USER: ${POSTGRES_USER}
@@ -132,6 +142,8 @@ services:
132142
dockerfile: apps/websocket/Dockerfile
133143
container_name: sr21_websocket
134144
restart: always
145+
env_file:
146+
- ../env/.env
135147
environment:
136148
NODE_ENV: production
137149
WS_HOST: ${HOST}
@@ -166,6 +178,8 @@ services:
166178
dockerfile: apps/ingestion/Dockerfile
167179
container_name: sr21_ingestion
168180
restart: always
181+
env_file:
182+
- ../env/.env
169183
environment:
170184
NODE_ENV: production
171185
POSTGRES_USER: ${POSTGRES_USER}
@@ -193,6 +207,8 @@ services:
193207
dockerfile: apps/updater/Dockerfile
194208
container_name: sr21_updater
195209
restart: always
210+
env_file:
211+
- ../env/.env
196212
environment:
197213
NODE_ENV: production
198214
POSTGRES_USER: ${POSTGRES_USER}

0 commit comments

Comments
 (0)