You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.**Set `ENABLE_HTTPS=true` in your `.env` file:**
93
+
```env
94
+
ENABLE_HTTPS=true
95
+
NEXTAUTH_URL=https://localhost:3000
96
+
```
97
+
98
+
2.**Restart containers:**
99
+
```bash
100
+
docker-compose up -d
101
+
```
102
+
103
+
The app will automatically generate self-signed certificates on first startup. Browsers will show a security warning, but you can proceed and Safari barcode scanning will work.
104
+
105
+
#### Option B: Custom Certificates
106
+
107
+
1.**Generate or obtain your SSL certificates** and place them in a `certs` directory:
108
+
```bash
109
+
mkdir -p certs
110
+
# Copy your cert.pem and key.pem files here
111
+
# Or use the provided script:
112
+
./scripts/generate-self-signed-cert.sh
113
+
```
114
+
115
+
2.**Enable HTTPS in `.env`:**
116
+
```env
117
+
ENABLE_HTTPS=true
118
+
SSL_CERT_PATH=/app/certs/cert.pem
119
+
SSL_KEY_PATH=/app/certs/key.pem
120
+
NEXTAUTH_URL=https://yourdomain.com
121
+
```
122
+
123
+
3.**The certificates will be automatically mounted** via the volume in `docker-compose.yml`
124
+
125
+
**Note:** For production with proper SSL certificates, consider using a reverse proxy (nginx, Traefik, Caddy) with `ENABLE_HTTPS=false` and let the proxy handle SSL termination.
126
+
86
127
### 4. Run Database Migrations
87
128
88
129
Migrations run automatically on container startup. If you need to run them manually:
Copy file name to clipboardExpand all lines: HTTPS_SETUP.md
+82Lines changed: 82 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,8 +100,90 @@ If port 3000 is busy, you can change it in `server.js`:
100
100
constport=3001; // or any available port
101
101
```
102
102
103
+
## Option 3: Docker/Production HTTPS Setup
104
+
105
+
For Docker deployments, HTTPS can be enabled with automatic self-signed certificate generation:
106
+
107
+
### Quick Setup (Auto-generated Certificates)
108
+
109
+
1.**Enable HTTPS in your `.env` file:**
110
+
```env
111
+
ENABLE_HTTPS=true
112
+
NEXTAUTH_URL=https://localhost:3000
113
+
```
114
+
115
+
2.**Start your containers:**
116
+
```bash
117
+
docker-compose up -d
118
+
```
119
+
120
+
That's it! The app will automatically generate self-signed certificates on first startup. Safari will show a security warning, but you can proceed and barcode scanning will work.
121
+
122
+
### Using Custom Certificates
123
+
124
+
If you want to provide your own certificates:
125
+
126
+
1.**Generate certificates** (optional - you can use the provided script):
0 commit comments