0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2024-12-30 22:34:01 -05:00

Added init Docker files

ref  ENG-1594

- initial docker files, copy and pasted from our spike we did in Spain
  early this year. https://www.notion.so/ghost/Double-down-on-Docker-30cc59d498da44058fb64e0ce8bebff4
This commit is contained in:
Ronald Langeveld 2024-10-07 14:31:22 +01:00
parent 084022a30d
commit 3bc6913bc2
3 changed files with 58 additions and 0 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
node_modules

19
Dockerfile Normal file
View file

@ -0,0 +1,19 @@
FROM node:18.18.2
WORKDIR /app
COPY package.json ./
COPY yarn.lock ./
COPY . .
# Install node-gyp globally
RUN npm install -g node-gyp
RUN yarn install
RUN npm rebuild
EXPOSE 2368
CMD ["yarn", "dev"]

38
docker-compose.yml Normal file
View file

@ -0,0 +1,38 @@
version: '3.8'
services:
nodejs:
build:
context: .
dockerfile: Dockerfile
container_name: ghost-node
restart: unless-stopped
ports:
- "2368:2368"
volumes:
- .:/app
networks:
- app-network
mysql:
image: mysql:8.0.35
hostname: ghost-mysql-2
container_name: ghost-mysql-2
# We'll need to look into how we can further fine tune the memory usage/performance here
command: --innodb-buffer-pool-size=1G --innodb-log-buffer-size=500M --innodb-change-buffer-max-size=50 --innodb-flush-log-at-trx_commit=0 --innodb-flush-method=O_DIRECT
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ghost
restart: always
healthcheck:
test: "mysql -uroot -proot ghost -e 'select 1'"
interval: 1s
retries: 120
networks:
- app-network
networks:
app-network:
driver: bridge