mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-12-15 20:16:10 +05:00
Merge branch 'feature/docker' into 'main'
Dockerfile See merge request foxixus/neomovies-api!5
This commit is contained in:
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM golang:1.23-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN git clone https://gitlab.com/foxixus/neomovies-api .
|
||||
|
||||
RUN go mod download
|
||||
RUN go build -o neomovies main.go
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/neomovies .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["./neomovies"]
|
||||
27
docker-compose.yml
Normal file
27
docker-compose.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .
|
||||
container_name: neomovies-backend
|
||||
ports:
|
||||
- "4000:3000"
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- MONGO_URI=mongodb://db:27017/neomovies
|
||||
- BASE_URL=http://localhost:3000
|
||||
- FRONTEND_URL=http://localhost:3001
|
||||
- NODE_ENV=production
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mongo:4.4
|
||||
container_name: neomovies-database
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- ~/files/docker/neomovies-database:/data/db
|
||||
restart: unless-stopped
|
||||
Reference in New Issue
Block a user