create docker container from app
This commit is contained in:
parent
709da8cc9a
commit
6aef6db4e4
23
packages/reservation-platform/.containerignore
Normal file
23
packages/reservation-platform/.containerignore
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Ignore node_modules as they will be installed in the container
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Ignore build artifacts
|
||||||
|
.next
|
||||||
|
|
||||||
|
# Ignore runtime data
|
||||||
|
db/
|
||||||
|
|
||||||
|
# Ignore local configuration files
|
||||||
|
.env
|
||||||
|
.env.example
|
||||||
|
|
||||||
|
# Ignore version control files
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Ignore IDE/editor specific files
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
*.DS_Store
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
37
packages/reservation-platform/Containerfile
Normal file
37
packages/reservation-platform/Containerfile
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
FROM node:20-bookworm
|
||||||
|
|
||||||
|
# Create application directory
|
||||||
|
RUN mkdir -p /usr/src/app
|
||||||
|
|
||||||
|
# Set environment variables
|
||||||
|
ENV PORT 3000
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
ENV RUNTIME_ENVIRONMENT=development
|
||||||
|
ENV OAUTH_CLIENT_ID=client_id
|
||||||
|
ENV OAUTH_CLIENT_SECRET=client_secret
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Copy package.json and pnpm-lock.yaml
|
||||||
|
COPY package.json /usr/src/app
|
||||||
|
COPY pnpm-lock.yaml /usr/src/app
|
||||||
|
|
||||||
|
# Install pnpm
|
||||||
|
RUN corepack enable pnpm
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pnpm install
|
||||||
|
|
||||||
|
# Copy the rest of the application code
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
# Initialize Database
|
||||||
|
RUN pnpm run db
|
||||||
|
|
||||||
|
# Build the application
|
||||||
|
RUN pnpm run build
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
# Start the application
|
||||||
|
CMD ["pnpm", "start"]
|
13
packages/reservation-platform/compose.yml
Normal file
13
packages/reservation-platform/compose.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Containerfile
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
environment:
|
||||||
|
NODE_ENV: development
|
||||||
|
OAUTH_CLIENT_ID: 521f431132202fd5225d
|
||||||
|
OAUTH_CLIENT_SECRET: 12084446d467ad4bce75ace54d881a8287321d32
|
||||||
|
#volumes:
|
||||||
|
# - ./docker-test/db:/usr/src/app/db
|
Loading…
x
Reference in New Issue
Block a user