build(docker): setup Dockerfile, docker-compose and .env
This commit is contained in:
parent
a30bda9de3
commit
8ffd8a7f0f
5 changed files with 45 additions and 0 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
README.md
|
||||
.env
|
||||
.env.example
|
||||
.gitignore
|
11
.env.example
Normal file
11
.env.example
Normal file
|
@ -0,0 +1,11 @@
|
|||
##############
|
||||
# PostgreSQL #
|
||||
##############
|
||||
POSTGRES_PASSWORD=your_database_password
|
||||
POSTGRES_USER=your_database_user
|
||||
POSTGRES_DB=les-copaings
|
||||
|
||||
##############
|
||||
# Bot #
|
||||
##############
|
||||
TOKEN=your_token
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -22,3 +22,4 @@
|
|||
go.work
|
||||
|
||||
.idea
|
||||
.env
|
||||
|
|
13
Dockerfile
Normal file
13
Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
|||
FROM golang:1.22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN apk add git
|
||||
|
||||
RUN go mod tidy && go build -o app .
|
||||
|
||||
ENV TOKEN=""
|
||||
|
||||
CMD ./app -token $TOKEN
|
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
services:
|
||||
bot:
|
||||
build: .
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./tmp:/app/config
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
redis:
|
||||
image: redis:alpine
|
||||
postgres:
|
||||
image: postgres:alpine
|
||||
env_file:
|
||||
- .env
|
Loading…
Add table
Add a link
Reference in a new issue