Skip to content

Commit 72cde77

Browse files
committed
preparing environment
1 parent adda0ce commit 72cde77

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM rust:1-buster
2+
3+
# RUN set -x \
4+
# && apk upgrade --no-cache \
5+
# && apk add --no-cache --virtual build-dependencies \
6+
# build-base libc-dev linux-headers openssl openssl-dev bash \
7+
# postgresql-dev postgresql-client openssl git less libpq \
8+
# musl-dev wget git gcc
9+
10+
WORKDIR /app
11+
12+
COPY . /app
13+
14+
RUN cargo install diesel_cli --no-default-features --features postgres --verbose
15+
RUN cargo build

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app: cargo run

diesel.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# For documentation on how to configure this file,
2+
# see diesel.rs/guides/configuring-diesel-cli
3+
4+
[print_schema]
5+
file = "src/schema.rs"
6+
import_types = ["diesel::sql_types::*", "diesel_citext::sql_types::*"]

docker-compose.yml.sample

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version: '2.4'
2+
services:
3+
4+
database:
5+
image: library/postgres:13-alpine
6+
volumes:
7+
- postgres_data:/var/lib/postgresql/data
8+
ports:
9+
- "5445:5432"
10+
environment:
11+
POSTGRES_PASSWORD: example
12+
POSTGRES_USER: postgres
13+
POSTGRES_DB: mfmserver_development
14+
command: 'postgres -c max_connections=300 -c shared_buffers=1GB'
15+
networks:
16+
mfmserver_net:
17+
ipv4_address: 10.77.0.24
18+
logging:
19+
driver: "json-file"
20+
options:
21+
max-size: "10m"
22+
max-file: "1"
23+
24+
app:
25+
build:
26+
context: .
27+
dockerfile: Dockerfile
28+
tty: true
29+
stdin_open: true
30+
volumes:
31+
- ./:/app
32+
- /app/tmp
33+
links:
34+
- database
35+
environment:
36+
DATABASE_URL: postgres://postgres:example@database:5432/mfmserver_development
37+
ports:
38+
- "3000:3000"
39+
command: 'cargo run'
40+
networks:
41+
mfmserver_net:
42+
ipv4_address: 10.77.0.23
43+
logging:
44+
driver: "json-file"
45+
options:
46+
max-size: "10m"
47+
max-file: "1"
48+
49+
volumes:
50+
postgres_data:
51+
networks:
52+
mfmserver_net:
53+
driver: bridge
54+
ipam:
55+
config:
56+
- subnet: 10.77.0.0/24

0 commit comments

Comments
 (0)