-
Notifications
You must be signed in to change notification settings - Fork 16
🧱 dockerize frontend / backend #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
505c9b3
ee480ca
68432bb
c83ea92
ed17721
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| FROM rust:latest AS build | ||
| WORKDIR /app | ||
| COPY . . | ||
| RUN cargo build --release | ||
|
|
||
| FROM debian:bookworm-slim | ||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| netcat-openbsd \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| RUN useradd -m appuser | ||
| WORKDIR /app | ||
| COPY --from=build /app/target/release/guild-backend /app/app | ||
| ENV RUST_LOG=info PORT=3001 | ||
| EXPOSE 3001 | ||
| USER appuser | ||
| CMD ["/app/app"] | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| version: "3.9" | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:16 | ||
| environment: | ||
| POSTGRES_USER: guild_user | ||
| POSTGRES_PASSWORD: guild_password | ||
| POSTGRES_DB: guild_genesis | ||
| ports: | ||
| - "5432:5432" | ||
| volumes: | ||
| - pg_data:/var/lib/postgresql/data | ||
|
|
||
| backend: | ||
| build: ./backend | ||
| command: ["/app/app"] | ||
| environment: | ||
| RUST_LOG: debug | ||
| RUST_BACKTRACE: 1 | ||
| PORT: 3001 | ||
| env_file: | ||
| - .env | ||
| ports: | ||
| - "3001:3001" | ||
| depends_on: | ||
| - postgres | ||
|
|
||
| frontend: | ||
| build: ./frontend | ||
| command: npm run dev -- --host 0.0.0.0 --port 4321 | ||
| ports: | ||
| - "4321:4321" | ||
| environment: | ||
| HOST: 0.0.0.0 | ||
| PORT: 4321 | ||
| PUBLIC_WALLET_CONNECT_PROJECT_ID: ${PUBLIC_WALLET_CONNECT_PROJECT_ID} | ||
| PUBLIC_API_URL: ${PUBLIC_API_URL} | ||
| depends_on: | ||
| - backend | ||
|
|
||
| volumes: | ||
| pg_data: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| FROM node:20-alpine AS build | ||
| WORKDIR /app | ||
| RUN apk add --no-cache python3 make g++ | ||
| COPY package*.json ./ | ||
| RUN npm ci | ||
| COPY . . | ||
| RUN npm run build | ||
|
|
||
| FROM node:20-alpine | ||
| WORKDIR /app | ||
| ENV NODE_ENV=production | ||
| COPY --from=build /app ./ | ||
joelamouche marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ENV PORT=8080 | ||
| EXPOSE 8080 | ||
| CMD ["node", "server.js"] | ||
Uh oh!
There was an error while loading. Please reload this page.