mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-05 05:05:17 +02:00
Add startup script and update Dockerfile and docker-compose.yml
This commit is contained in:
parent
33122894c2
commit
8250cae054
3 changed files with 19 additions and 8 deletions
|
@ -19,8 +19,13 @@ RUN npm run build
|
||||||
# Expose the port that the app is listening on
|
# Expose the port that the app is listening on
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
|
|
||||||
|
RUN chmod +x ./startup.sh
|
||||||
|
|
||||||
# The USER instruction sets the user name to use as the default user for the remainder of the current stage
|
# The USER instruction sets the user name to use as the default user for the remainder of the current stage
|
||||||
USER node:node
|
USER node:node
|
||||||
|
|
||||||
# This is the command that will be run inside the image when you tell Docker to start the container
|
# get permission to run startup script
|
||||||
CMD ["node", "build/index.js"]
|
|
||||||
|
# Run startup.sh instead of the default command
|
||||||
|
CMD ["./startup.sh"]
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
# depends_on:
|
environment:
|
||||||
# - db
|
- DATABASE_URL=postgresql://seanmorley15:1XGfuKoO9wcH@ep-withered-violet-a5xm4eqj.us-east-2.aws.neon.tech/demo?sslmode=require
|
||||||
# db:
|
|
||||||
# image: postgres
|
|
||||||
# environment:
|
|
||||||
# POSTGRES_PASSWORD: example
|
|
||||||
|
|
8
startup.sh
Normal file
8
startup.sh
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Start your application here
|
||||||
|
# Example: node build/index.js
|
||||||
|
# print message
|
||||||
|
echo "Starting the application"
|
||||||
|
npm run migrate
|
||||||
|
node build/index.js
|
Loading…
Add table
Add a link
Reference in a new issue