mirror of
https://github.com/philipredstone/relnet.git
synced 2025-06-16 20:51:16 +02:00
Update Dockerfile and add docker-compose for standalone and traefik
This commit is contained in:
parent
d6e1162631
commit
3e3b8930b5
@ -1,5 +1,5 @@
|
||||
PORT=5000
|
||||
MONGODB_URI=mongodb://localhost:27017/friendship-network
|
||||
JWT_SECRET=your_jwt_secret_key_change_this
|
||||
CLIENT_URL=http://localhost:3000
|
||||
APP_URL=http://localhost:3000
|
||||
ENABLE_REGISTRATION=true
|
@ -38,4 +38,10 @@ COPY --from=frontend-builder /frontend/dist/ /app/frontend/dist
|
||||
COPY --from=backend-builder /app/dist /app/dist
|
||||
COPY package.json .
|
||||
|
||||
ENV PORT=80
|
||||
ENV MONGODB_URI=mongodb://db:27017/friendship-network
|
||||
ENV JWT_SECRET=7hPqh6pS91WCQY
|
||||
ENV APP_URL=http://localhost:80
|
||||
ENV ENABLE_REGISTRATION=true
|
||||
|
||||
CMD ["yarn", "run", "start"]
|
||||
|
33
docker-compose.traefik.yml
Normal file
33
docker-compose.traefik.yml
Normal file
@ -0,0 +1,33 @@
|
||||
networks:
|
||||
internal:
|
||||
internal: true
|
||||
traefik:
|
||||
external: true
|
||||
|
||||
services:
|
||||
relnet:
|
||||
image: github.com/philipredstone/relnet:latest
|
||||
build: .
|
||||
networks:
|
||||
- internal
|
||||
- traefik
|
||||
environment:
|
||||
- PORT=80
|
||||
- MONGODB_URI=mongodb://relnet-db:27017/friendship-network
|
||||
- JWT_SECRET=your_jwt_secret_key_change_this
|
||||
- APP_URL=http://localhost:80
|
||||
- ENABLE_REGISTRATION=true
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.relnet.rule=Host(`relnet`)"
|
||||
- "traefik.http.routers.relnet.entrypoints=websecure"
|
||||
- "traefik.http.routers.relnet.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.relnet.loadbalancer.server.port=80"
|
||||
|
||||
relnet-db:
|
||||
image: mongo:latest
|
||||
networks:
|
||||
- internal
|
||||
restart: always
|
||||
volumes:
|
||||
- db:/data/db
|
26
docker-compose.yml
Normal file
26
docker-compose.yml
Normal file
@ -0,0 +1,26 @@
|
||||
networks:
|
||||
internal:
|
||||
internal: true
|
||||
|
||||
services:
|
||||
relnet:
|
||||
image: github.com/philipredstone/relnet:latest
|
||||
build: .
|
||||
ports:
|
||||
- "80:80"
|
||||
networks:
|
||||
- internal
|
||||
environment:
|
||||
- PORT=80
|
||||
- MONGODB_URI=mongodb://relnet-db:27017/friendship-network
|
||||
- JWT_SECRET=your_jwt_secret_key_change_this
|
||||
- APP_URL=http://localhost:80
|
||||
- ENABLE_REGISTRATION=true
|
||||
|
||||
relnet-db:
|
||||
image: mongo:latest
|
||||
networks:
|
||||
- internal
|
||||
restart: always
|
||||
volumes:
|
||||
- db:/data/db
|
@ -17,7 +17,7 @@ app.use(express.json());
|
||||
app.use(cookieParser());
|
||||
app.use(
|
||||
cors({
|
||||
origin: process.env.CLIENT_URL || 'http://localhost:3000',
|
||||
origin: process.env.APP_URL || 'http://localhost:3000',
|
||||
credentials: true,
|
||||
})
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user