29 lines
No EOL
842 B
Docker
29 lines
No EOL
842 B
Docker
FROM debian:latest
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
curl gnupg2 ca-certificates lsb-release apt-transport-https \
|
|
postgresql caddy nodejs npm && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN echo "listen_addresses='*'" >> /etc/postgresql/15/main/postgresql.conf && \
|
|
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/15/main/pg_hba.conf && \
|
|
echo "host all all ::/0 md5" >> /etc/postgresql/15/main/pg_hba.conf
|
|
|
|
# Set up working directory for Express app
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
|
|
COPY caddy/Caddyfile /etc/caddy/Caddyfile
|
|
|
|
# Copy entrypoint script
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
# Expose required ports
|
|
EXPOSE 80 3000 5432
|
|
|
|
# Use the entrypoint script to start everything
|
|
ENTRYPOINT ["/docker-entrypoint.sh"] |